{tpl head}
<body style="width:700px;min-height:400px;">
<div class="pop_win">
    <form name="groupPriceForm">
        <table class="border_table" style="width:100%">
            <thead>
            <tr>
                <th>会员组名称</th>
                <th>商品价格</th>
                <th>默认价格</th>
                <th>会员组折扣率</th>
            </tr>
            </thead>
            <tbody>
            {loop $groupList $v}
            <tr class='td_c'>
                <td>{$v.group_name}</td>
                <td><input type="text" name="groupPrice{$v.id}" class="small" pattern="float" /></td>
                <td>￥{function=(($v.discount/100)*$sell_price)}</td>
                <td>{$v.discount}</td>
            </tr>
            {/loop}
            </tbody>
        </table>
    </form>
</div>
<script type='text/javascript'>
    $(function(){
        var groupPrice = art.dialog.data('groupPrice');
        if(groupPrice)
        {
            var groupPriceObject = $.parseJSON(groupPrice);
            for(var groupId in groupPriceObject)
            {
                $('input[name="groupPrice'+groupId+'"]').val(groupPriceObject[groupId]);
            }
        }
    });
</script>
